<?php
        header("Content-type:text/html;charset=utf-8");
        $con = mysqli_connect("localhost", 'root', '', 'ksdb2');
        mysqli_set_charset($con, "utf8");
        
        $st_id = $_GET['st_id'];
        
        $cs_id = $_GET['cs_id'];
        
        $sc_grade = $_GET['sc_grade'];
        

        $sql = "INSERT INTO select_course (st_id, cs_id, sc_grade) VALUES ('$st_id','$cs_id','$sc_grade');";
        
        
        // 执行插入语句
        if($con->query($sql))
        {
            echo "添加成功";
        //删完回去表页面
        }
        else{
            echo "添加失败";
        }
        
        // 回到首页
        header("location:selectcourse.php");
        mysqli_close($con);
    ?>